﻿Imports System
Imports System.Net.Sockets
Imports System.Text
Imports System.Threading
Module Module1
    Sub Main()
        Dim serverIP As String = "127.0.0.1" ' 服务器IP地址
        Dim port As Integer = 8000 ' 服务器端口号
        Dim client As TcpClient = New TcpClient(serverIP, port)
        Dim stream As NetworkStream = client.GetStream()

        Console.WriteLine("Connected to server.")

        While True
            Console.Write("Enter message to send: ")
            Dim message As String = Console.ReadLine()
            If message.ToLower() = "exit" Then
                Break
            End If

            Dim messageBytes As Byte() = Encoding.ASCII.GetBytes(message)
            stream.Write(messageBytes, 0, messageBytes.Length)
            Console.WriteLine("Message sent: " & message)
        End While

        client.Close()
        Console.WriteLine("Disconnected from server.")
    End Sub

    Private Sub Break()
        Throw New NotImplementedException()
    End Sub
End Module
Public Class Form3
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

    End Sub

    Private Sub Button3_Click_1(sender As Object, e As EventArgs) Handles Button3.Click
        Dim dlg As New Windows.Forms.FontDialog
        If Form4.ShowDialog() = DialogResult.OK Then
            Console.WriteLine(Form4.Font.ToString())
        End If
    End Sub
End Class